home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1998 #1
/
Amiga Plus 1998 #1.iso
/
demo-versionen
/
haage&partner
/
warpup-warpos
/
source
/
tools
/
showtasks.p
< prev
next >
Wrap
Text File
|
1997-09-24
|
5KB
|
144 lines
incdir include:
incdir lvo:
** '(C) Copyright 1997 Haage & Partner Computer GmbH'
** All Rights Reserved
include powerpc/ppcmacros.i
include powerpc/powerpc.i
include powerpc/tasksppc.i
include exec/nodes.i
include powerpc_lib.i
include exec_lib.i
include dos_lib.i
STRUCTURE TASKINFO,0
APTR TASKINFO_NAME
APTR TASKINFO_LOCATION
ULONG TASKINFO_TYPE
ULONG TASKINFO_STATE
ULONG TASKINFO_PRI
ULONG TASKINFO_MMUSETUP
ULONG TASKINFO_TABLE
ULONG TASKINFO_STACKSIZE
ULONG TASKINFO_SPLOWER
ULONG TASKINFO_SIGALLOC
ULONG TASKINFO_SIGWAIT
ULONG TASKINFO_SIGRECVD
LABEL TASKINFO_SIZE
xref _SysBase
xref _DOSBase
xref _PowerPCBase
xref _LinkerDB
smalldata
executable
escapestr
version 10
start
prolog 1024
pushgpr r28-r31
la r4,PPCInfo_Tags
CALLPOWERPC GetInfo
lw r28,Tag_PAGETABLE
lnk r29,-TASKINFO_SIZE
subi r29,r29,TASKINFO_SIZE
CALLPOWERPC LockTaskList
mr r31,r3
.loop
lwz r30,LN_SUCC(r31)
tstw r30
beq .done
lwz r31,TASKPTR_TASK(r31)
lwz r0,LN_NAME(r31)
stw r0,TASKINFO_NAME(r29)
stw r31,TASKINFO_LOCATION(r29)
la r3,customtask
lwz r4,TASKPPC_FLAGS(r31)
bittst r4,TASKPPCP_SYSTEM
beq .nosystem
la r3,systemtask
.nosystem
stw r3,TASKINFO_TYPE(r29)
lbz r4,TC_STATE(r31)
la r3,state_run
cmplwi r4,TS_RUN
beq .statedone
la r3,state_ready
cmplwi r4,TS_READY
beq .statedone
la r3,state_wait
.statedone
stw r3,TASKINFO_STATE(r29)
lba r3,LN_PRI(r31)
stw r3,TASKINFO_PRI(r29)
lwz r4,TASKPPC_FLAGS(r31)
la r3,pagedMMU
bittst r4,TASKPPCP_BAT
beq .nobat
la r3,batMMU
.nobat
stw r3,TASKINFO_MMUSETUP(r29)
lwz r0,TASKPPC_TABLE(r31)
tstw r0
bne .cont
mr r0,r28
.cont
stw r0,TASKINFO_TABLE(r29)
lwz r0,TASKPPC_STACKSIZE(r31)
stw r0,TASKINFO_STACKSIZE(r29)
lwz r0,TC_SPLOWER(r31)
stw r0,TASKINFO_SPLOWER(r29)
lwz r0,TC_SIGALLOC(r31)
stw r0,TASKINFO_SIGALLOC(r29)
lwz r0,TC_SIGWAIT(r31)
stw r0,TASKINFO_SIGWAIT(r29)
lwz r0,TC_SIGRECVD(r31)
stw r0,TASKINFO_SIGRECVD(r29)
la _d1,infotext
mr _d2,r29
RUN68K_XL _DOSBase,VPrintf
mr r31,r30
b .loop
.done
CALLPOWERPC UnLockTaskList
.close
addi r29,r29,TASKINFO_SIZE
ulnk r29,-TASKINFO_SIZE
popgpr
epilog
section data
PPCInfo_Tags
dc.l PPCINFO_PAGETABLE
Tag_PAGETABLE dc.l 0
dc.l 0
infotext dc.b "Task name: %s\n"
dc.b "Task location: %08lx\n"
dc.b "Task type: %s\n"
dc.b "Task state: %s\n"
dc.b "Task priority: %ld\n"
dc.b "MMU setup: %s\n"
dc.b "Page table location: %08lx\n"
dc.b "Stack size: %ld\n"
dc.b "Stack location (lower bound): %08lx\n"
dc.b "Signals allocated: %08lx\n"
dc.b "Signals to wait: %08lx\n"
dc.b "Signals received: %08lx\n\n"
dc.b 0
customtask dc.b "CUSTOM",0
systemtask dc.b "SYSTEM",0
state_run dc.b "RUNNING",0
state_ready dc.b "READY",0
state_wait dc.b "WAITING",0
pagedMMU dc.b "PAGED MMU SETUP",0
batMMU dc.b "BAT SETUP",0